package net.huashitong.Indicators.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.Indicators.dao.LoginLogDao;
import net.huashitong.Indicators.entity.LoginLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginLogService extends StringPKService<LoginLog> {

    @Autowired
    private LoginLogDao dao;
    @Autowired
    private SysTableService tableService;

    @Override
    protected BaseDao<LoginLog, String> getDao() {
        return dao;
    }
    @Override
    protected void beforeSave(LoginLog obj) {
        obj.setSysId(tableService.updateMaxSysId("LOGIN_LOG", null));
    }

}
